Command-line switches

There are a lot of options in lxLite. I simply like options :-) So, you can configure almost anything in lxLite. Moreover, to protect the user from need of writing the same options lxLite support multiple configurations which are kept in a single file. lxLite comes with some example configurations (`factory defaults`) which are listed below:


default (loaded by default)
It is a `work` configuration. All parameters are set to optimal level of compression without too much effort applied. File backup is disabled except for files that have extra data after LX structure. Note that this configuration is ALWAYS loaded before any other options are in effect, so even /C{#} option is executed AFTER default configuration is loaded.
unpack (loaded for /X option)
This configuration is loaded when you request to unpack the file (/X). By default it is empty; you can add here everything you want to happen when files are unpacked.
ver2x
Optimal for pre-Warp versions of OS/2. Versions before Warp (3.0) does not know of the Lempel-Ziv (/EXEPACK:2) method. DON`T PACK EXECUTABLES WITH LEMPEL-ZIV`s ALGORITHM if there is a chance to run your program on OS/2 v2.xx (except 2.99).
max
Tightest compression level. VERY SLOW! It is rarely needed to use this configuration.
newStub
This is a particular configuration used to replace one DOS stub in LX executable by another without altering anything else. You have to specify a filename for new stub - this configuration only tells lxLite not to depack old objects and not to pack unpacked objects.
minStub
This is a configuration which is linked to newStub and replaces stubs in given files by minimal possible stub of `say-error-and-exit` type. You cannot make it smaller (at least I doubt it), only if you shorten the error message.
vdmStub
This configuration tells lxLite to replace in specified files stub by a `run-from-VDM`-style one. This is also as short as possible :-) Please read the /T{#} option description for further details.
info
Use this configuration to get the most important information about executables (see option /V) without altering them.
exehdr
Shows complete information about the executable header. Module file is not altered in any way.
exemap
Shows anything about the executable structure. This can generate sometimes very long data sheets, so use it only if really needed.
map
Shows the memory map of the executable: memory objects and pages which makes the object.
exp
Shows everything that is exported from the module (exported names and exported entriy points)
imp
Shows module import tables
pdd
This configuration can be used for physical device drivers (especially in NE format).
dll
This configuration is useful for dynamic-link libraries.

To use a specific configuration use the /C:# switch where # is configuration`s identifier. Settings are loaded from file lxLite.CFG in the same directory where lxLite.EXE resides. You shouldn`t care about paths - lxLite will always find it. For example, to use `max` configuration run lxLite /c:Max. For a detailed description of .CFG file format see section right below the following.

Here is a detailed explanation of what each switch does. Note that any switch which accepts '+' or '-' sign after it (to enable/disable the action which switch symbolizes) can be used without anything after it - this is accepted as '+'. For example, /V+ is equivalent to /V.


/A[{P|S|N{P|S}}{:#}]
Set alignment method for first and rest of objects. First object can be aligned on [P]age shift, [S]ector or [N]o boundary. Note that the last option (No boundary) cannot be achieved by using LINK386, but it works well, and the LX format allows it. All objects except first MUST be aligned on at least PageShift boundary. PageShift is a value that is specified in LX header. You can redefine it too by specifying a semicolon and a decimal value after it: for example the /APP:512 switch will place all pages in executable on 512 bytes boundary. Note that the # value must be a power of two (i.e. 1,2,4,8,16,32,...).
/B(D|X|+|-){:%}
Enable (+) or disable (-) copying original file into *.BAK; optionaly lxLite can do it only when [D]ebug and/or e[X]tra data are detected. Also you can specify an directory % for backed up files (relative to root). The entire directory tree will be re-created inside the backup directory. For example, the /BX:c:\lxlite.bak switch will instruct lxLite to back up files only when e[X]tra data is present in module and to place them into the directory structure under the c:\lxlite.bak directory.
/C{S}{+|-}
Enable (+) or disable (-) colored output. You can specify {S} to force lxLite to use StdOut instead of VioXXX functions.
/C[:%]
Use configuration with ID = %; The two predefined configuration names are "default" and "unpack". First is always loaded as lxLite starts and second is used when /X+ option is specified (this is NOT equivalent to /c:Unpack).
/E{#}
Set [E]xclude filemask. All files that fits given filemask(s) will be bypassed by lxLite. All filemasks must be separated by ':' (because it cannot be a part of filemask). For example /D*.zip:*.arj:*.rar switch will instruct lxLite to avoid all .zip, .arj and .rar files. Default lxlite configuration (/C:default) includes the /C:exclude configuration which instructs lxLite to avoid all executables which are known to have problems when packed. Note that the /D switches are additive, so /D*.zip /D*.arj /D*.rar is equivalent to the example above. To clear exclusion list use specify /D.
/F{+|-}
Force repacking. Use /F+ to bypass `already processed` message, i.e. when lxLite thinks that file was already processed and it really wasn`t. This usually doesn`t happen, but can happen when you try to replace a stub by another of the same size in a already packed file.
/I{+|-}
Force (+) lxLite to run at idle priority. This mean that lxLite will do its work only when no other activity in system occurs (waiting for an keyboard/mouse event etc). This is the best in my opinion choice because you can run lxLite in background and it will not degrade almost at all system performance. However if you`ll run an `badly-behaved` VDM session which grabs all CPU time lxLite will completely stop. When run with /I- option lxLite does not changes its priority (i.e. you can run lxLite /I- via priority.exe program which starts programs with given priority).
/J[A|E|L|P|V](E|L|P|V|N|X|+|-)
Change module type: Leave [A]s-is, [E]xecutable module, [L]ibrary module, [P]hysical or [V]irtual driver. Especially useful when converting NE drivers. Optionaly you can restrict this to work only on [E]xecutables, [L]ibraries, [P]hysical or [V]irtual drivers, [N]E or L[X] executables and any combination of them. [N]E and [L]X conditions are considered with an AND operator; all others with OR, i.e. /JPELN will mean: "Change module type into [P]hysical device driver for all [E]xecutables OR [L]ibraries which also are (AND) [N]E modules"
/L(A|S|U|+|-){:%}
Instructs lxLite to maintain an log file. If no file name is specified, lxLite.log is used in the home directory of lxLite. Beside the filename, the start and final file size is written into log along with the problems (if any) that were encountered when processing (for example: 'Executable has been used by another process and replaced'). You can also optionaly choose to log either [S]uccessful or [U]nsuccessful cases or [A]ll (which means more than just /SU+: lxLite will also log 'already processed' files).
/M[R[N|1|2|3]|L[N|1]|F[N|1|2]]
Set packing method & parameters. Second character (after M) defines the method to set-up: `R` stands for run-length (/EXEPACK:1), 'L' for Lempel-Ziv (/EXEPACK:2) and 'F' for Fixup packing method. The third character is the level of compression using that method; if N is specified the method is disabled. Three levels of packing are provided for run-length compression. The level 1 is the fastest. It searches only for 1-character strings. For example, the 'AAAAAAAA' string will be detected and packed as 8, 1, 'A' while 'ABABABAB' string will be stored as unpacked text. Level 2 detects repeated strings of up to 16 characters length, so the example above will be encoded as 4,2,'AB'. This is the default setting for most 'factory` configurations. And last, 3rd level searchs for ALL strings of any length (up to page size/2 = 2048). This compreses VERY slow and seldom gives real results, so use it only when you really need it. The Lempel-Ziv algorithm can be either disabled (/MLN) or enabled (/ML1). When enabled it searchs for all matches using a relatively fast hash-table, so there is no need in gradations by compression speed. The fixup packing method can be set to [N]one, level 1 end level 2; fixups packed using Level 1 are recognized by any OS/2 version above 2.x; however level 2 compressed fixups will work only in OS/2 Warp 3.0 with (fixpack #17 (I believe)) and above (Warp 4.0 too). Note that when /MF1 or /MF2 is in use, the /U{+|-} option is ignored - module is always unpacked first.
/N(B|L|A|+|-)
[N]E executables: convert into LX (+) or reject (-) modules that are [B]ound, not [L]FN-aware or [A]ll. For more information about [B] and [L] option see the 'Features' section above. For example, the /NA- option will instruct lxLite not to convert NE files into LX, the /NA+ will instruct to convert always; the /NA-LB+ will instruct lxLite to convert ONLY non-[L]FN-aware and [B]ound executables, the /NA+LB- will instruct lxLite to convert [A]ll except non-[L]FN-aware and [B]ound executables.
/O(X|D|S|A|+|-){:%}
[O]utput e[X]tra/[D]ebug/[S]tub data into an external file; filename is determined by applying mask % onto original filename. Data is written [A]lways in the A+ state and only when removed in the A- state. For example, the /OD:*.$d$ switch will have effect on the TEST.EXE executable which contains debug info only when you choose to discard it and will place it into the file TEST.$d$.
/P{+|-}
Enable (+) or disable (-) pause before each file. The program shows the name of file which will be processed and offers a choice to continue or to abort.
/Q{+|-}
Query all configuration options. Basically it simply types a colored version of lxLite.cfg file through a MORE-style filter :-) All other options on the command line (if any) are ignored.
/R{+|-}
Enable (+) or disable (-) [R]ecursive file search through subdirectories.
/S{+|-}
Show (+) or don`t show (-) configuration in effect. This is useful for examining which settings are stored into .CFG file, especially for linked configurations (see below). For example lxLite /Cdefault /S will show the default settings.
/T{:%}
Use specified file as new DOS stub. DOS stub is (usualy) a tiny DOS .EXE file linked to OS/2`s module which is typicaly used to type an error message in the case if the executable is not run from DOS command line. Usually this looks like:

This is an OS/2 executable module

Along with lxLite are enclosed two stubs: stub_min.bin and stub_vdm.bin. First is the standard `type-error-and-exit` type, but it is slightly smaller than usual stubs used by various linkers. The second is an stub which starts a new OS/2 session and runs program from it again. If OS/2 is not detected it types the same error message and exits. The default for stub_vdm.bin is to let OS/2 decide the type of your executable itself. Alternatively, you can specify the type of session to be started by stub_vdm.bin. For this you need any hex editor - find the pattern `SesType->' in stub and replace the byte that comes after arrow (->) by needed session type. OS/2 recognizes next session types:

You can use stubs to do some neat tricks. Say you have two executables: ZIP for OS/2 and ZIP for DOS (I mean GNU ZIP, not PKZIP). They offer the same interface, does the same thing and share the same name. To avoid conflicts (and avoid placing them in different directories) you can link them both together into one EXE file which can be ran either from DOS or OS/2 mode. This can be achieved by following command line:

lxLite /t:dos\zip.exe os2\zip.exe

If stub size is bigger than certain threshold size (default - 1024 bytes) it will not be replaced. This is done since stubs of bigger size usualy does something useful (for example, this can be already an 'dual-mode' executable). It is useful for batch conversions and not too useful when you do tricks like described above: so you can wish to change this threshold value to zero. This can be achieved using the /Z switch (see below for details).

/U{+|-}
Enable (+) or disable (-) unpacking file before packing. lxLite know how to unpack any of two packing methods described, so default option state is enabled. Disable it only when compression time savings are more important than disk space savings. This option is ignored (and file is anyway unpacked) when /MF2 packing is enabled.
/V[{0123OCRNMPEF}{+|-}]
[V]erbose (show a lot of file information).
This is a switch for curious ones :-) It has different levels of verbosity, you can choose which kind of information to include in overall output. For example: /V0-12+3-O+. Here is an detailed description of what each key shows:
/W(W|S|+|-)
[W]rite (+) or [S]imulate writing of resulting file. In the /WW- state lxLite will do nothing (useful for /V option); in the /WS+ state lxLite will even display compression ratio, but won`t alter the module file on disk. Useful for /V{...} switch, but also can be useful for debugging your options.
/X{+|-}
e[X]pand (+) or pack (-) given files. Use this switch to decompress files. lxLite can decompress files which has been compressed by itself as well as by other programs which uses standard methods (i.e. Resource Compiler, LINK386, REPACK). It is NOT identical to /c:Unpack option.
/Y[U|X|B|C|D]{?}
auto-repl[Y] '?' on one of questions: If reply (?) is missing, lxLite will ask you interactively each time. When lxLite asks you a question, you can press Alt+letter which will set the default answer for all following similar questions.
/Z{:#}
This option will set the `threshold` for lxLite to help him determine when stub is a `dummy` one and when it is a functional program. There are a number of programs (for example, \os2\xdfloppy.exe) which runs both under DOS and OS/2 - in such programs DOS executable is implemented into OS/2`s LX as a DOS stub. By default lxLite considers all stubs bigger than 1024 bytes as functional programs, and therefore for such executables the /T{:#} option has no effect. If you want stub to be always replaced, use the /Z option. If you want to disable the /T option, use /Z-1.
/?,/H
Show a brief help. This is useful when you forget a particular switch from all that list :-)

Title page | Introduction | Features | Configuration file | Error messages | Bugs and limitations | Thanks... | Utility Pack | Author info